#ifndef _W25Q128_H_
#define _W25Q128_H_

#include "stm32f4xx.h"   
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "sys.h"
#include "delay.h"


#define W25QXX_SCLK   	PBout(3)
#define W25QXX_MOSI   	PBout(5)
#define W25QXX_SS   	PBout(14)
#define W25QXX_MISO		PBin(4)


void W25QXX_INIT(void);
uint8_t W25qxx_SendByte(uint8_t byte);
uint8_t W25qxx_ReadByte(void);
void W25qxx_Write_Enable(void);
void W25qxx_Write_Disable(void);
uint8_t W25qxx_Readstatus(void);
void W25qxx_Erase(uint32_t ReadAddr);
void W25qxx_ReadData(uint8_t* databuf, uint32_t ReadAddr,int lenth);
void W25qxx_Writedata(uint8_t* databuf, uint32_t ReadAddr,int lenth);
uint16_t W25qxx_ReadID(void);


#endif
